import { defineStore } from "pinia";
import { Names } from "../../store-namespace";
import { _get, _post, _put, _delete, http } from "@/utils/axios";
import { ElNotification } from "element-plus"; //处理导航信息
import { ServiceEmploye } from "@/api/backend/index";
import { mapCompanies } from "@/utils/common";

export const useStaff = defineStore(Names.Staff, {
  state: () => {
    return {
      single: {
        createBy: null,
        createTime: null,
        id: 0,
        name: "",
        phone: "",
        providerId: 0,
        remark: null,
        updateBy: null,
        updateTime: null,
        idPhoto: "",
        idPhotoBack: "",
        qualification: "",
        photo: "",
      },
      employeeId: 0,
    };
  },
  getters: {},
  actions: {
    //获取售后人员单个/列表数据
    getSingleAndListStaffAuto(filter: any) {
      return new Promise((resolve, reject) => {
        _get(ServiceEmploye + "/list", filter, "json", "").then((res) => {
          console.log("获取售后人员单个/列表数据", res);
          resolve(res);
        });
      });
    },
    //编辑服务商信息
  },
});
